Skip to content

Fix external inputs breaking base parameter spreads - #20062

Merged
polatengin merged 9 commits into
mainfrom
polatengin/19954-externalinput-for-parent-bicepparam-breaks-spread-operator-for-child-bicepparam
Jul 21, 2026
Merged

Fix external inputs breaking base parameter spreads#20062
polatengin merged 9 commits into
mainfrom
polatengin/19954-externalinput-for-parent-bicepparam-breaks-spread-operator-for-child-bicepparam

Conversation

@polatengin

@polatengin polatengin commented Jul 15, 2026

Copy link
Copy Markdown
Member

Description

Fixes #19954.

When a parent parameter file contains an externalInput, using the spread operator with another inherited parameter could fail with BCP338.

In this PR;

I've added tests that reproduce the issue with ...base.B

I've fixed the issue in ExpressionBuilder by evaluating only the selected base parameter

I've also added coverage for object and array spreads, property access, bracket access, and nested parameter files

Checklist

Microsoft Reviewers: Open in CodeFlow

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 29834720488)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 29834720488
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 29834720488"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 29834720488
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 29834720488"

@levimatheri

Copy link
Copy Markdown
Contributor

Can we add a test case for this? I just tested it with your fix, but seems it's failing:

shared.bicepparam:

using none
param external = externalInput('foo', 'bar')
param B = {
  parent: 'parent'
}

main.bicepparam:

using 'main.bicep'

extends 'shared.bicepparam'
param B = {
  ...base.external
  something: 'something'
}

@polatengin

Copy link
Copy Markdown
Member Author

Can we add a test case for this? I just tested it with your fix, but seems it's failing:

@levimatheri I've added the regression test and fixed dependency tracking for selected base parameters containing externalInput.

I moved ProcessInlinableSymbol from a local function inside VisitVariableAccessSyntax to a private method so the same dependency propagation logic can also be reused by VisitPropertyAccessSyntax.

This allows base.external to mark the dependent assignment for inlining and emit the expected externalInputs(...) expression.

@polatengin
polatengin merged commit 12ad173 into main Jul 21, 2026
43 checks passed
@polatengin
polatengin deleted the polatengin/19954-externalinput-for-parent-bicepparam-breaks-spread-operator-for-child-bicepparam branch July 21, 2026 13:30
@github-project-automation github-project-automation Bot moved this from Todo to Done in Bicep Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

externalInput for parent bicepparam breaks spread operator for child bicepparam

2 participants